package com.zh.springcloud.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.security.oauth2.provider.token.TokenStore;
import org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStore;

/**
 * @Description:
 * @ClassName RedisConfig
 * @date: 2021.10.29 16:49
 * @Author: zhanghang
 */
//@Configuration
public class RedisConfig {

	@Autowired
	private RedisConnectionFactory redisConnectionFactory;

	/**
	 * description: 配置token管理 
	 * date: 2021年-10月-29日 16:50
	 * author: zhanghang
	 * 
	 * @param 
	 * @return org.springframework.security.oauth2.provider.token.TokenStore
	 */ 
	@Bean("reidsTokenStore")
	public TokenStore reidsTokenStore(){
		return new RedisTokenStore(redisConnectionFactory);
	}
}
